<template>
  <div class="Button">
    <div class="Button_box">
      <div @click="Button_box_show">
        <img
          src="https://o6wndwjxn.qnssl.com/%E5%9B%BE%E6%A0%87%E4%B8%80@2x.png"
          alt=""
        >
        <div>后台播放</div>
      </div>
      <div @click="Button_box_share">
        <img
          src="https://o6wndwjxn.qnssl.com/%E5%88%86%E4%BA%AB@2x.png"
          alt=""
        >
        <div>分享</div>
      </div>
      <div @click="Button_box_collection">
        <img
          v-if="is_gz === 0"
          src="https://o6wndwjxn.qnssl.com/%E6%94%B6%E8%97%8F@2x.png"
          alt=""
        >
        <img
          v-else
          src="https://o6wndwjxn.qnssl.com/%E7%9F%A9%E5%BD%A2@2x.png"
          alt=""
        >
        <div>收藏</div>
      </div>
      <div @click="Button_box_comment">
        <img
          src="https://o6wndwjxn.qnssl.com/%E8%AF%84%E8%AE%BA@2x.png"
          alt=""
        >
        <div>评论</div>
      </div>
    </div>
  </div>
</template>

<script>

export default {
  props: ['type', 'is_gz', 'Details', 'css'],
  data () {
    return {

    }
  },
  created () {
    console.log(this.css)
  },
  methods: {
    Button_box_show () {
      if (window.__wxjs_is_wkwebview !== true) {
        window.location.href = 'https://a.app.qq.com/o/simple.jsp?pkgname=com.zhongtian.zhiyun'
      } else {
        window.location.href = `/xiazai?has=true&type=${this.css}&chapter_id=${this.Details.chapter_id}&curriculum_id=${this.Details.curriculum_id}`
      }
      // this.$emit('Button_box_show')
    },
    Button_box_share () {
      this.$emit('ButtonShare')
    },
    Button_box_comment () {
      this.$store.commit('evaluate', true)
      this.$emit('ButtonComment')
    },
    Button_box_collection () {
      if (this.type) {
        this.$emit('ButtonCollection')
      } else {
        this.$emit('ButtonCollection', 1)
      }
    }
  }
}
</script>

<style>
.Button_box {
  width: 100%;
  height: 50px;
  display: flex;
}
.Button_box > div {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: #1a1a1a;
}
.Button_box > div img {
  height: 20px;
  margin: 5px 0;
}
</style>
